/*
 * @Author: your name
 * @Date: 2021-02-23 17:01:34
 * @LastEditTime: 2021-06-08 12:36:43
 * @LastEditors: zws
 * @Description: In User Settings Edit
 * @FilePath: \serve\src\db\sequelize.js
 */


import { Sequelize, Model, DataTypes } from "sequelize";
import { logger } from '@/utils/logger'
// 建立连接
const sequelize = new Sequelize("tricolorcat", "tricolorcat", "6mtn3N35m56WzYr4", {
    host: "127.0.0.1",
    dialect: "mysql",
    // operatorsAliases: false,
    pool: {
        max: 30,
        min: 0,
        acquire: 30000,
        idle: 10000
    },
    logging(sql) {
        logger.error(sql);
    }
});

export { sequelize, Model, DataTypes };
